home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2978 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: nic.wat.hookup.net!news
  2. From: xenon@the-fix.sos.on.ca
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Streams
  5. Date: Wed, 24 Jan 1996 21:54:52 GMT
  6. Organization: HookUp Communication Corporation, Waterloo, Ontario, CANADA
  7. Message-ID: <4e6ame$i2d@nic.wat.hookup.net>
  8. References: <DLnvnp.229@rci.ripco.com>
  9. NNTP-Posting-Host: slip2.sos.on.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. mambuhl@ripco.com (Martin Ambuhl) wrote:
  13.  
  14. >xenon@the-fix.sos.on.ca
  15. >in <4e0lp3$lkf@nic.wat.hookup.net> writes:
  16.  
  17. >>HI,  im having some trouble getting my program to write to streams...
  18. >>ex:
  19.  
  20. >Since your program appears to have no errors, and compiles and runs
  21. >just fine for me with bcc or gcc, I would suggest that you re-install
  22. >the compiler, making sure that you skip no steps.  Dot every i and cross
  23. >every t.
  24.  
  25.     Ahhh...the joys of having the original disks.....
  26.     Could this be a options/settings problem in BTC++?
  27. >>#include <stdio.h>
  28.  
  29. >>int main(void)
  30. >>{
  31. >>   FILE *stream;
  32. >>   int i = 100;
  33. >>   char c = 'C';
  34. >>   float f = 1.234;
  35.  
  36. >>   /* open a file for update */
  37. >>   stream = fopen("DUMMY.FIL", "w+");
  38.  
  39. >>   /* write some data to the file */
  40. >>   fprintf(stream, "%d %c %f", i, c, f);
  41.  
  42. >>   /* close the file */
  43. >>   fclose(stream);
  44. >>   return 0;
  45. >>}
  46.  
  47.  
  48. >>        This example taken out of the Borland Help library should work fine.
  49. >>Yet, nothing is written to the file "dummy.fil".  although the file is
  50. >>created.  I have tried running my comiler from Dos and Win95 to no
  51. >>avail.  My stream problem is no just centered around the disk file
  52. >>streams, but also stdout, and stderr.  Strangely though, my read() and
  53. >>write() functions work just fine.
  54. >>thankx
  55. >>xenon@the-fix.sos.on.ca
  56. >                          
  57. >--
  58. >* Martin Ambuhl       net: mambuhl@ripco.com
  59. >* Chicago, IL (USA)    
  60.  
  61.  
  62.